/*
 * Created on Jun 10, 2005
 *
 */
package com.erclab.internal.xpresso.formelements;

import com.erclab.internal.xpresso.forms.Form;

/**
 * @author Enrique Rodriguez.
 *
 */
public class SimpleTextArea extends SimpleInputBox {

	/* (non-Javadoc)
	 * @see com.erclab.internal.xpresso.formelements.FormElement#toHTML(com.erclab.internal.xpresso.forms.Form, com.erclab.internal.xpresso.forms.FormParameters)
	 */
	public String toHTML(Form theForm) {
		StringBuffer sb = new StringBuffer();
		sb.append("<TEXTAREA Name=\"Field");
		sb.append(idFormElement + "\" class=\"" + this.style + "TextArea\">");
		if (theForm.getFormParameters().getAction().equals("update")){
			if(originalValue != null){
				sb.append(originalValue);
			}
		} else {
			if(lookupValue != null){
				sb.append(this.lookupValue);
			}
		}
		sb.append("</TEXTAREA>");
		return sb.toString();
	}

}
